
			<div class="container">
				<div class="roles-form">
				<div class="page-header" style="position:relative;">
					<h3>Add Role </h3>
				</div>
					<?php echo form_open('roles/add','class ="form-horizontal" ', 'id = "roles-form"'); ?>
    					<div class="control-group">
							<label class="control-label" for="role">Role<span style="color: red;">*</span></label>
							<div class="controls">
								<input type="text" name="role" id="role" value="<?php echo set_value('role'); ?>"/>
							 	<label class="error"><?php echo form_error('role'); ?></label>
							</div>
						</div>
                        <hr />
                        <div class="control-group">
							<label class="control-label" for="role_name">Role Name<span style="color: red;">*</span></label>
							<div class="controls">
								<input type="text" name="role_name" id="role_name" value="<?php echo set_value('role_name'); ?>"/>
								<label class="error"><?php echo form_error('role_name'); ?></label>
							</div>
						</div>
                        <hr />
                        <div class="control-group">
                        	<label class="control-label" for="permission">Permission</label>
                            <div class="controls">
                            	<table style="height:373px; width:203px; overflow:auto; display:block;" border="1">
                                	<tr><td><input type="checkbox" class="chk_boxes"  /><b> Select All</b></td></tr>
											<?php foreach($priv as $r):?> 
											<tr><td><input type="checkbox" class="chk_boxes1" name="chk[<?php echo $r->id_priv ?>]" value=<?php echo $r->id_priv ?>  />
											<?php echo $r->priv_name ?> </td></tr>
                                        	<?php endforeach ?>

                                    
                                </table>
							</div>
                        </div>
                        <div class="form-actions">
 							<input class="btn btn-primary" id="submit" type="submit" value="Save Role" />
							<input class="btn" id="cancel" type="button" name="cancel" value="Cancel" onclick="self.history.back()" />    
                        </div>
					<?php echo form_close(); ?>
				</div>
			</div>
        <script type="text/javascript" language="javascript">
			$(function() {
  				$('.chk_boxes').click(function(){
					var chk = $(this).attr('checked')?true:false;
					$('.chk_boxes1').attr('checked',chk);
				});
			});
		</script> 

		